home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / flight-of-the-museum.swf / scripts / engine / levelData / Level_05.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  6.4 KB  |  185 lines

  1. package engine.levelData
  2. {
  3.    import copy.CopyBank;
  4.    import engine.WorldScene;
  5.    import engine.dynamicObjects.*;
  6.    
  7.    public class Level_05 extends LevelData
  8.    {
  9.        
  10.       
  11.       public function Level_05()
  12.       {
  13.          super();
  14.          _goalParameters = new Array();
  15.       }
  16.       
  17.       override public function buildLevel() : *
  18.       {
  19.          var i:* = undefined;
  20.          var rNum:* = undefined;
  21.          var podium:* = undefined;
  22.          var cage:* = undefined;
  23.          var px:Number = NaN;
  24.          var indian:* = undefined;
  25.          var fuelIcon:* = undefined;
  26.          var giantTentacle:* = undefined;
  27.          var goalObj:Object = null;
  28.          var missionObj:Object = null;
  29.          super.buildLevel();
  30.          rNum = Math.random();
  31.          for(i = 0; i < 5; i++)
  32.          {
  33.             rNum = Math.random();
  34.             px = 150 + Math.random() * 100 + i * 200;
  35.             if(rNum < 0.3)
  36.             {
  37.                podium = new Podium("tall");
  38.                podium.x = px;
  39.                podium.y = 700;
  40.                WorldScene.Instance.GameplayObjects.push(podium);
  41.                cage = new Cage1();
  42.                cage.x = podium.x;
  43.                cage.y = 568;
  44.                WorldScene.Instance.GameplayObjects.push(cage);
  45.                WorldScene.Instance.Cages.push(cage);
  46.             }
  47.             if(rNum >= 0.3 && rNum < 0.6)
  48.             {
  49.                podium = new Podium("med");
  50.                podium.x = px;
  51.                podium.y = 700;
  52.                WorldScene.Instance.GameplayObjects.push(podium);
  53.                cage = new Cage1();
  54.                cage.x = podium.x;
  55.                cage.y = 582;
  56.                WorldScene.Instance.GameplayObjects.push(cage);
  57.                WorldScene.Instance.Cages.push(cage);
  58.             }
  59.             if(rNum >= 0.6)
  60.             {
  61.                podium = new Podium("short");
  62.                podium.x = px;
  63.                podium.y = 700;
  64.                WorldScene.Instance.GameplayObjects.push(podium);
  65.                cage = new Cage1();
  66.                cage.x = podium.x;
  67.                cage.y = 604;
  68.                WorldScene.Instance.GameplayObjects.push(cage);
  69.                WorldScene.Instance.Cages.push(cage);
  70.             }
  71.          }
  72.          for(i = 0; i < 5; i++)
  73.          {
  74.             rNum = Math.random();
  75.             px = 1750 + Math.random() * 100 + i * 200;
  76.             if(rNum < 0.3)
  77.             {
  78.                podium = new Podium("tall");
  79.                podium.x = px;
  80.                podium.y = 700;
  81.                WorldScene.Instance.GameplayObjects.push(podium);
  82.                cage = new Cage1();
  83.                cage.x = podium.x;
  84.                cage.y = 568;
  85.                WorldScene.Instance.GameplayObjects.push(cage);
  86.                WorldScene.Instance.Cages.push(cage);
  87.             }
  88.             if(rNum >= 0.3 && rNum < 0.6)
  89.             {
  90.                podium = new Podium("med");
  91.                podium.x = px;
  92.                podium.y = 700;
  93.                WorldScene.Instance.GameplayObjects.push(podium);
  94.                cage = new Cage1();
  95.                cage.x = podium.x;
  96.                cage.y = 582;
  97.                WorldScene.Instance.GameplayObjects.push(cage);
  98.                WorldScene.Instance.Cages.push(cage);
  99.             }
  100.             if(rNum >= 0.6)
  101.             {
  102.                podium = new Podium("short");
  103.                podium.x = px;
  104.                podium.y = 700;
  105.                WorldScene.Instance.GameplayObjects.push(podium);
  106.                cage = new Cage1();
  107.                cage.x = podium.x;
  108.                cage.y = 604;
  109.                WorldScene.Instance.GameplayObjects.push(cage);
  110.                WorldScene.Instance.Cages.push(cage);
  111.             }
  112.          }
  113.          indian = new Indian();
  114.          indian.x = 2900;
  115.          indian.y = 710;
  116.          WorldScene.Instance.GameplayObjects.push(indian);
  117.          WorldScene.Instance.Indians.push(indian);
  118.          indian = new Indian();
  119.          indian.x = 3000;
  120.          indian.y = 710;
  121.          indian.LobMode = true;
  122.          WorldScene.Instance.GameplayObjects.push(indian);
  123.          WorldScene.Instance.Indians.push(indian);
  124.          fuelIcon = new FuelIcon();
  125.          fuelIcon.x = 4000;
  126.          fuelIcon.y = 2000;
  127.          WorldScene.Instance.GameplayObjects.push(fuelIcon);
  128.          fuelIcon = new FuelIcon();
  129.          fuelIcon.x = 5000;
  130.          fuelIcon.y = 2000;
  131.          WorldScene.Instance.GameplayObjects.push(fuelIcon);
  132.          giantTentacle = new GiantTentacle();
  133.          giantTentacle.r = -Math.PI / 1.35;
  134.          giantTentacle.baseX = 150;
  135.          giantTentacle.baseY = 1200;
  136.          giantTentacle.hiddenX = 350;
  137.          giantTentacle.hiddenY = 1600;
  138.          giantTentacle.init();
  139.          WorldScene.Instance.TentacleObjects.push(giantTentacle);
  140.          giantTentacle = new GiantTentacle();
  141.          giantTentacle.r = -Math.PI / 1.35;
  142.          giantTentacle.baseX = 2600;
  143.          giantTentacle.baseY = 1200;
  144.          giantTentacle.hiddenX = 2600;
  145.          giantTentacle.hiddenY = 1600;
  146.          giantTentacle.init();
  147.          WorldScene.Instance.TentacleObjects.push(giantTentacle);
  148.          giantTentacle = new GiantTentacle();
  149.          giantTentacle.r = -Math.PI / 1.1;
  150.          giantTentacle.baseX = 3050;
  151.          giantTentacle.baseY = 1200;
  152.          giantTentacle.hiddenX = 3250;
  153.          giantTentacle.hiddenY = 1600;
  154.          giantTentacle.init();
  155.          WorldScene.Instance.TentacleObjects.push(giantTentacle);
  156.          giantTentacle = new GiantTentacle();
  157.          giantTentacle.r = -Math.PI / 1.1;
  158.          giantTentacle.baseX = 3450;
  159.          giantTentacle.baseY = 1200;
  160.          giantTentacle.hiddenX = 3250;
  161.          giantTentacle.hiddenY = 1600;
  162.          giantTentacle.init();
  163.          WorldScene.Instance.TentacleObjects.push(giantTentacle);
  164.          _missionDescription = CopyBank.Instance.MissionDesc_Cages;
  165.          goalObj = {
  166.             "Type":"Cage",
  167.             "Count":10
  168.          };
  169.          _goalParameters.push(goalObj);
  170.          missionObj = {
  171.             "Description":_missionDescription,
  172.             "BoundsX":_missionBoundsX,
  173.             "BoundsHint":_missionBoundsHint,
  174.             "GoalParamaters":_goalParameters,
  175.             "PrimaryGoalType":"Cages",
  176.             "StartLoc":{
  177.                "x":400,
  178.                "y":400
  179.             }
  180.          };
  181.          WorldScene.Instance.setMissionDetails(missionObj);
  182.       }
  183.    }
  184. }
  185.